//二级菜单
let oBlock = document.getElementsByClassName('nn')[0];
let oA = document.getElementById('a');
oA.onmouseover = function(){
    oBlock.style.display = 'block';
}
oA.onmouseout = function(){
    oBlock.style.display = 'none';
}
oBlock.onmouseover = function(){
    oBlock.style.display = 'block';
}
oBlock.onmouseout= function(){
    oBlock.style.display = 'none';
}



//导航栏接口
$.get("goodsAndShoppingCart/getGoodsType.php", function (restext) {
    console.log(restext);
    for(let j=0;j< $(".twolist").length;j++){
        let i=j;
        $(".twolist").eq(j).html(`${restext[i].goodsType}`)
    }   
},"json");
//导航栏吸顶
window.onscroll = function(){
    if($(window).scrollTop()>800){   
        $('.oIn').addClass('oIn2')         
        
        $('.topfix').css({
            display : 'block'
        })
        
    }else{
        $('.oIn').removeClass('oIn2')   
        $('.topfix').css({
            display : 'none'
        })
        
    }
}
$(".topfix").click(function(){
    $(window).scrollTop(0);
});